﻿import Messages = require('Framework/Messages');

export class App
{
    public static Main(): void
    {
        var subscriber1: Messages.SomeEventSubscriber = new Messages.SomeEventSubscriber();
        var subscriber2: Messages.SomeEventSubscriber = new Messages.SomeEventSubscriber();

        subscriber1.Subscribe();
        subscriber2.Subscribe();

        Messages.MessagesRepoInstance.MessagesLoaded.Trigger(['Test message 1'], this);
        Messages.MessagesRepoInstance.ErrorHappened.Trigger({ Error: 'Test error 1' });

        subscriber1.Destroy();

        Messages.MessagesRepoInstance.MessagesLoaded.Trigger(['Test message 2'], this);
        Messages.MessagesRepoInstance.ErrorHappened.Trigger({ Error: 'Test error 2' });
    }
}


